package cn.itsource.org.service.impl;

import cn.itsource.org.domain.Employee;
import cn.itsource.org.domain.Logininfo;
import cn.itsource.org.mapper.EmployeeMapper;
import cn.itsource.org.mapper.LogininfoMapper;
import cn.itsource.org.service.IEmployeeService;
import cn.itsource.basic.base.service.impl.BaseServiceImpl;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zhi
 * @since 2022-07-05
 */
@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee> implements IEmployeeService {
    @Autowired
    private LogininfoMapper logininfoMapper;

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public void delete(Long id) {
        Employee employee = employeeMapper.loadById(id);
        logininfoMapper.delete(employee.getId());
        employeeMapper.deleteRoleById(id);
        super.delete(id);
    }

}
